/*
 * Copyright (c) 2024 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef BUS_I2C_MUX_H
#define BUS_I2C_MUX_H

#include "internal/bus/bus_base/bus.h"
#include "internal/hasdef.h"
#include <mc/engine.h>

namespace dev {

class bus_i2c_mux : public bus_base {
public:
    bool init(mc::mutable_dict& csr_object);

    // 实现虚函数
    uint32_t read(ACCESS_DATA_S& input) override;
    uint32_t write(ACCESS_DATA_S& input) override;
    uint8_t  get_id() override;
    void     bus_lock() override;
    void     bus_unlock() override;

private:
    uint8_t m_channel_id = 0;
};

} // namespace dev

#endif // BUS_I2C_MUX_H